<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>奖品详情</title>
	<link rel="stylesheet" href="__PUBLIC__/Product/css/prize_detail.css" />
	<script src="__PUBLIC__/Product/js/lib/flexible.js"></script>
</head>
<body style="background-color: #f4f4f4;"> 
	<div class="orderDetail_box">
		<!--头部-->
		<div class="orderDetail_header">
			<img src="__PUBLIC__/Product/img/fanhui.png" alt="返回">
            <p>奖品详情</p>
		</div>
		<!--内容-->
		<div class="orderDetail_content">
			<div class="orderDetail_con_top">
				<p class="orderState"></p>
			</div>
			<div class="logistic">
				<div class="logistic_left">
					<img src="__PUBLIC__/Product/img/car.png" alt="" />
				</div>
				<div class="logistic_con">
					<p class="packageState">包裹正在等待揽收</p>
					<!--<p>2017-04-17 13:25:20</p>-->
				</div>
				<div class="logistic_right">
					<img src="__PUBLIC__/Product/img/right.png"/>
				</div>
			</div>
			<div class="address">
				<div class="address_left">
					<img src="__PUBLIC__/Product/img/address.png" alt="" />
				</div>
				<div class="address_right">
					<p class="address_rt_top">
						收货人：<span class="name"></span><span class="telephone"></span>
					</p>
					<p class="address_rt_bot">
						收货地址：<span></span>
					</p>
				</div>
			</div>
			<!--订单-->
			<div class="orderDetail_box">
                <!--<div class="orderDetail_num">
                    <span>订单编号：</span>
                    <span>201754812547821475144</span>
                    <span>交易成功</span>
                </div>-->
                <div class="orderDetail_con">
                    <div class="orderDetail_con_lt">
                        <div class="lt_imgBox">
                        	奖品名称:
                        	<!--<img src="__PUBLIC__/Product/img/iphone.png" alt="" />-->
                        </div>
                    </div>
                    <div class="orderDetail_con_rt">
                        <p class="p_top">
                            <span></span>
                            <!--<span class="red">￥99.80</span>-->
                        </p>
                        <p class="p_bot">
                            <!--<span>话费已到账，13兑币已到账</span>-->
                            <!--<span class="red">x1</span>-->
                        </p>
                    </div>
                </div>
                <div class="orderDetail_bot">
                    <!--<p class="num-money">
                    	共<span>1</span>件商品，合计：￥<span>102.8</span>(含运费￥3.0)
                    </p>-->
                    <div class="return_goods">查看物流</div>
                </div>
            </div>
            <!--订单号、时间-->
            <div class="orderNum-time">
            	<p>中奖时间：<span>2017-04-17 12:12:12</span></p>
            	<p>领奖时间：<span>2017-04-17 12:12:12</span></p>
            	<p class="fahuo">发货时间：<span>2017-04-17 12:12:12</span></p>
            </div>
		</div>
	</div>
</body>
</html>
<script src="__PUBLIC__/Product/js/lib/jquery3.2.1.js"></script>
<script>
	$(function(){
		var obj = {
			orderState:$('.orderState'),			// 订单状态
			logistic:$('.logistic'),				// 物流状态
			fahuotime:$('.fahuo'),					// 发货时间	
			name:$('.address_rt_top .name'),		// 收件人
			tel:$('.address_rt_top .telephone'),	// 电话
			adress:$('.address_rt_bot span'),		// 地址
			prizename:$('.p_top span'),				// 奖品名称
			search:$('.return_goods')				// 查看物流
		}
		$.ajax({
			type: 'post',
            url: 'http://a.91jfk.com/Product/Prize/prize_order_list',
            data:{
            	id:GetRequest().id
            },
            dataType: 'json',
            success: function(res) {
                console.log(res);
                if (res.code == '1') {
                	var data = res.msg;
                	obj.name.text(data.name);
                	obj.tel.text(data.tel);
                	obj.adress.text(data.address);
                	obj.prizename.text(data.title);
                	switch(data.state){
                		case '1':
                			obj.orderState.text('待发货');
                			obj.search.hide();
                			obj.fahuotime.hide();
                			break;
                		case '2':
                			obj.orderState.text('已发货');
                			obj.logistic.hide();
                			break;
                		case '3':
                			obj.orderState.text('已签收');
                			obj.logistic.hide();
                			obj.search.hide();
                			break;
                		default:
                			break;
                	}
                }
            },
            // 加载出错
            error: function(err) {
                console.log('Ajax error!');
            }
		});
		function GetRequest() {
			var url = location.search;
			var theRequest = new Object();
			if(url.indexOf("?") != -1) {
				var str = url.substr(1);
				strs = str.split("&");
				for(var i = 0; i < strs.length; i++) {
					theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
				}
			}
			return theRequest;
		}
	});
</script>